home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Puzzle / PuzzlePuzzle.swf / scripts / DefineButton2_295 / BUTTONCONDACTION on(keyPress w).as
Encoding:
Text File  |  2005-08-05  |  4.0 KB  |  136 lines

  1. on(keyPress "w"){
  2.    if(0 < mannumber)
  3.    {
  4.       man.gotoandplay("down");
  5.       sound.gotoandplay("up");
  6.       ascore = score;
  7.       tjs = 10;
  8.       while(tjs >= 0)
  9.       {
  10.          if(a[manx][tjs] != 0)
  11.          {
  12.             tt = tjs + 1;
  13.             at = tjs + 1;
  14.             break;
  15.          }
  16.          tjs--;
  17.       }
  18.       if(a[manx][0] == 0)
  19.       {
  20.          tt = 0;
  21.          at = 0;
  22.       }
  23.       i = 0;
  24.       while(i < mannumber)
  25.       {
  26.          if(mancolor == 1)
  27.          {
  28.             duplicateMovieClip("reds","gg" add (tt * 8 + manx),16384 + cheng);
  29.             setProperty("gg" add (tt * 8 + manx), _X, manx * 35 + 35);
  30.             setProperty("gg" add (tt * 8 + manx), _Y, tt * 35 + 55);
  31.             a[manx][tt] = 1;
  32.          }
  33.          else if(mancolor == 2)
  34.          {
  35.             duplicateMovieClip("blues","gg" add (tt * 8 + manx),16384 + cheng);
  36.             setProperty("gg" add (tt * 8 + manx), _X, manx * 35 + 35);
  37.             setProperty("gg" add (tt * 8 + manx), _Y, tt * 35 + 55);
  38.             a[manx][tt] = 2;
  39.          }
  40.          else if(mancolor == 3)
  41.          {
  42.             duplicateMovieClip("greens","gg" add (tt * 8 + manx),16384 + cheng);
  43.             setProperty("gg" add (tt * 8 + manx), _X, manx * 35 + 35);
  44.             setProperty("gg" add (tt * 8 + manx), _Y, tt * 35 + 55);
  45.             a[manx][tt] = 3;
  46.          }
  47.          else if(mancolor == 4)
  48.          {
  49.             duplicateMovieClip("yellows","gg" add (tt * 8 + manx),16384 + cheng);
  50.             setProperty("gg" add (tt * 8 + manx), _X, manx * 35 + 35);
  51.             setProperty("gg" add (tt * 8 + manx), _Y, tt * 35 + 55);
  52.             a[manx][tt] = 4;
  53.          }
  54.          tt += 1;
  55.          cheng += 1;
  56.          if(tt >= 10)
  57.          {
  58.             break;
  59.          }
  60.          i++;
  61.       }
  62.       bloon1 = mannumber == 1 && a[manx][tt - 3] == mancolor && a[manx][tt - 2] == mancolor;
  63.       if(mannumber >= 3 || mannumber == 2 && a[manx][tt - 3] == mancolor || bloon1)
  64.       {
  65.          ii = 1;
  66.          while(ii < 10)
  67.          {
  68.             if(a[manx][tt - ii] != mancolor)
  69.             {
  70.                break;
  71.             }
  72.             this["gg" add ((tt - ii) * 8 + manx)].gotoAndPlay("over");
  73.             score += 10;
  74.             a[manx][tt - ii] = 0;
  75.             che = 1;
  76.             while(8 >= che)
  77.             {
  78.                if(a[manx - che][tt - ii] != mancolor)
  79.                {
  80.                   break;
  81.                }
  82.                this["gg" add ((tt - ii) * 8 + manx - che)].gotoAndPlay("over");
  83.                score += 10;
  84.                a[manx - che][tt - ii] = 0;
  85.                si = 1;
  86.                while(11 >= si && a[manx - che][tt - ii + si] != 0)
  87.                {
  88.                   this["gg" add ((tt - ii + si) * 8 + manx - che)].gotoAndPlay("down");
  89.                   a[manx - che][tt - ii + si] = 0;
  90.                   si++;
  91.                }
  92.                che++;
  93.             }
  94.             che = 1;
  95.             while(8 >= che)
  96.             {
  97.                if(a[manx + che][tt - ii] != mancolor)
  98.                {
  99.                   break;
  100.                }
  101.                this["gg" add ((tt - ii) * 8 + manx + che)].gotoAndPlay("over");
  102.                score += 10;
  103.                a[manx + che][tt - ii] = 0;
  104.                si = 1;
  105.                while(11 >= si && a[manx + che][tt - ii + si] != 0)
  106.                {
  107.                   this["gg" add ((tt - ii + si) * 8 + manx + che)].gotoAndPlay("down");
  108.                   a[manx + che][tt - ii + si] = 0;
  109.                   si++;
  110.                }
  111.                che++;
  112.             }
  113.             ii++;
  114.          }
  115.       }
  116.       mannumber = 0;
  117.       ascore = score - ascore;
  118.       if(80 * za < score && score < za * 80 + 80 && z[za] != 1)
  119.       {
  120.          sssb();
  121.          char1.gotoandplay("ded");
  122.          z[za] = 1;
  123.          za += 1;
  124.       }
  125.       else if(ascore >= 60)
  126.       {
  127.          score += 30;
  128.          sssb();
  129.          char1.gotoandplay("happy");
  130.          p1k.gotoandplay(2);
  131.          char2.gotoandplay("cry");
  132.       }
  133.       mancolor = 0;
  134.    }
  135. }
  136.